<script setup name="UserAvatar">
const ipc = require("electron").ipcRenderer;
const handleSelect = (key) => {
  if(key === 'logout'){
    handleLogout();
  }
}

const handleLogout = () => {
  //ipc.send('window-closed', 1);
  ipc.send('window-new', {
    route: '/login',
    width: 400,
    height:480,
    frame: false,
    resizable: false,
    maximizable: false,
    fullscreen: false,
    movable: true,
  });
}

</script>

<template>
  <a-dropdown @select="handleSelect" position="br">
    <a-avatar :size="24" class="mr-2">
      <img src="@/assets/avatar.gif" />
    </a-avatar>
    <template #content>
        <a-doption value="setting">账号设置</a-doption>
        <a-doption value="logout">退出登录</a-doption>
      </template>
  </a-dropdown>
  
</template>

<style lang="less" scoped>
</style>